package com.company.cloud.uba.modules.app.service.impl;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.company.cloud.uba.modules.app.service.UserLogoutLogAppService;
import com.company.cloud.uba.modules.base.entity.UserLogoutLog;
import com.company.cloud.uba.modules.base.service.UserLogoutLogService;
import com.company.cloud.uba.utils.UbaIdUtils;
import com.company.common.server.config.mq.models.MQUserLogoutModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class UserLogoutLogAppServiceImpl implements UserLogoutLogAppService {

    @Autowired
    private UserLogoutLogService userLogoutLogService;

    @Override
    public void addUserLogout(MQUserLogoutModel params) {
        UserLogoutLog entity=new UserLogoutLog();
        entity.setId(UbaIdUtils.getUserLogoutLogId());
        entity.setUserId(params.getUserId());
        entity.setToken(params.getToken());
        entity.setAnonyToken(params.getAnonyToken());
        entity.setOpIp(params.getIp());
        entity.setOpDate(params.getOpDate());
        entity.setClientType(params.getClientType());
        entity.setMobileNo(params.getMobileNo());
        entity.setLlType(params.getLlType());
        entity.setLongitude(params.getLongitude());
        entity.setLatitude(params.getLatitude());
        userLogoutLogService.save(entity);
    }
}
